package data;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class Company extends AbstractData{
	private long id = -1;
	private long hotelId;
	
	private String name;
	private String logo;
	private String photo;
	private String address;
	private String address2;
	private String country;
	private String state;
	private String city;
	private String zipcode;
	private String phone;
	private String fax;
	private String website;
	private String vatid;
	private String descrition;
	
	private String billname;
	private String billaddress;
	private String billaddress2;
	private String billcountry;
	private String billstate;
	private String billcity;
	private String billzipcode;
	private String billphone;
	private String billfax;
	
	private String contactsalutation;
	private String contactfirstname;
	private String contactlastname;
	private String contactdesignation;
	private String contactphone;
	private String contactextn;
	private String contactfax;
	private String contactemail;
	private String contactmobile;
		
	public Company(){}
	
	public Company(long id)
	{
		this.id = id;
	}
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getHotelId() {
		return hotelId;
	}

	public void setHotelId(long hotelId) {
		this.hotelId = hotelId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getZipcode() {
		return zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public String getDescrition() {
		return descrition;
	}

	public void setDescrition(String descrition) {
		this.descrition = descrition;
	}

	public String getBillname() {
		return billname;
	}

	public void setBillname(String billname) {
		this.billname = billname;
	}

	public String getBilladdress() {
		return billaddress;
	}

	public void setBilladdress(String billaddress) {
		this.billaddress = billaddress;
	}

	public String getBillcountry() {
		return billcountry;
	}

	public void setBillcountry(String billcountry) {
		this.billcountry = billcountry;
	}

	public String getBillstate() {
		return billstate;
	}

	public void setBillstate(String billstate) {
		this.billstate = billstate;
	}

	public String getBillcity() {
		return billcity;
	}

	public void setBillcity(String billcity) {
		this.billcity = billcity;
	}

	public String getBillzipcode() {
		return billzipcode;
	}

	public void setBillzipcode(String billzipcode) {
		this.billzipcode = billzipcode;
	}

	public String getBillphone() {
		return billphone;
	}

	public void setBillphone(String billphone) {
		this.billphone = billphone;
	}

	public String getBillfax() {
		return billfax;
	}

	public void setBillfax(String billfax) {
		this.billfax = billfax;
	}

	public String getContactsalutation() {
		return contactsalutation;
	}

	public void setContactsalutation(String contactsalutation) {
		this.contactsalutation = contactsalutation;
	}

	public String getContactfirstname() {
		return contactfirstname;
	}

	public void setContactfirstname(String contactfirstname) {
		this.contactfirstname = contactfirstname;
	}

	public String getContactlastname() {
		return contactlastname;
	}

	public void setContactlastname(String contactlastname) {
		this.contactlastname = contactlastname;
	}

	public String getContactdesignation() {
		return contactdesignation;
	}

	public void setContactdesignation(String contactdesignation) {
		this.contactdesignation = contactdesignation;
	}

	public String getContactphone() {
		return contactphone;
	}

	public void setContactphone(String contactphone) {
		this.contactphone = contactphone;
	}

	public String getContactfax() {
		return contactfax;
	}

	public void setContactfax(String contactfax) {
		this.contactfax = contactfax;
	}

	public String getContactemail() {
		return contactemail;
	}

	public void setContactemail(String contactemail) {
		this.contactemail = contactemail;
	}

	public String getContactmobile() {
		return contactmobile;
	}

	public void setContactmobile(String contactmobile) {
		this.contactmobile = contactmobile;
	}

	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getVatid() {
		return vatid;
	}

	public void setVatid(String vatid) {
		this.vatid = vatid;
	}

	public String getBilladdress2() {
		return billaddress2;
	}

	public void setBilladdress2(String billaddress2) {
		this.billaddress2 = billaddress2;
	}

	public String getContactextn() {
		return contactextn;
	}

	public void setContactextn(String contactextn) {
		this.contactextn = contactextn;
	}

	public Entity getEntity()
	{
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.Company);
		else
			item = new Entity(this.key);
		item.setProperty("hotelId", this.hotelId);
		item.setProperty("name", this.name);
		item.setProperty("logo", this.logo);
		item.setProperty("photo", this.photo);
		item.setProperty("address", this.address);
		item.setProperty("address2", this.address2);
		item.setProperty("country", this.country);
		item.setProperty("state", this.state);
		item.setProperty("city", this.city);
		item.setProperty("zipcode", this.zipcode);
		item.setProperty("phone", this.phone);
		item.setProperty("fax", this.fax);
		item.setProperty("vatid", this.vatid);
		item.setProperty("website", this.website);
		item.setProperty("descrition", this.descrition);
		item.setProperty("billname", this.billname);
		item.setProperty("billaddress", this.billaddress);
		item.setProperty("billaddress2", this.billaddress2);
		item.setProperty("billcountry", this.billcountry);
		item.setProperty("billstate", this.billstate);
		item.setProperty("billcity", this.billcity);
		item.setProperty("billzipcode", this.billzipcode);
		item.setProperty("billphone", this.billphone);
		item.setProperty("billfax", this.billfax);
		item.setProperty("contactsalutation", this.contactsalutation);
		item.setProperty("contactfirstname", this.contactfirstname);
		item.setProperty("contactlastname", this.contactlastname);
		item.setProperty("contactdesignation", this.contactdesignation);
		item.setProperty("contactphone", this.contactphone);
		item.setProperty("contactextn", this.contactextn);
		item.setProperty("contactfax", this.contactfax);
		item.setProperty("contactemail", this.contactemail);
		item.setProperty("contactmobile", this.contactmobile);
		return item;
	}

	@Override
	public void setEntity(Entity entity) {
		
		this.id = entity.getKey().getId();
		this.hotelId = (Long) entity.getProperty("hotelId");
		this.name = (String) entity.getProperty("name");
		this.logo = (String) entity.getProperty("logo");
		this.photo = (String) entity.getProperty("photo");
		this.address = (String) entity.getProperty("address");
		this.address2 = (String) entity.getProperty("address2");
		this.country = (String) entity.getProperty("country");
		this.state = (String) entity.getProperty("state");
		this.city = (String) entity.getProperty("city");
		this.zipcode = (String) entity.getProperty("zipcode");
		this.phone = (String) entity.getProperty("phone");
		this.fax = (String) entity.getProperty("fax");
		this.vatid = (String) entity.getProperty("vatid");
		this.website = (String) entity.getProperty("website");
		this.descrition = (String) entity.getProperty("descrition");
		this.billname = (String) entity.getProperty("billname");
		this.billaddress = (String) entity.getProperty("billaddress");
		this.billaddress2 = (String) entity.getProperty("billaddress2");
		this.billcountry = (String) entity.getProperty("billcountry");
		this.billstate = (String) entity.getProperty("billstate");
		this.billcity = (String) entity.getProperty("billcity");
		this.billzipcode = (String) entity.getProperty("billzipcode");
		this.billphone = (String) entity.getProperty("billphone");
		this.billfax = (String) entity.getProperty("billfax");
		this.contactsalutation = (String) entity.getProperty("contactsalutation");
		this.contactfirstname = (String) entity.getProperty("contactfirstname");
		this.contactlastname = (String) entity.getProperty("contactlastname");
		this.contactdesignation = (String) entity.getProperty("contactdesignation");
		this.contactphone = (String) entity.getProperty("contactphone");
		this.contactextn = (String) entity.getProperty("contactextn");
		this.contactfax = (String) entity.getProperty("contactfax");
		this.contactemail = (String) entity.getProperty("contactemail");
		this.contactmobile = (String) entity.getProperty("contactmobile");

		this.key = entity.getKey();
	}
	public void LoadData() {
		if (this.id > -1) {
			Entity entity = LoadData(EntityName.Company, this.id);
			setEntity(entity);
		}
	}
}
